]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
windowManager: Move OSK gesture to KeyboardManager
authorCarlos Garnacho <carlosg@gnome.org>
Thu, 11 Feb 2021 12:41:16 +0000 (13:41 +0100)
committerMarge Bot <marge-bot@gnome.org>
Wed, 17 Feb 2021 15:45:01 +0000 (15:45 +0000)
It would be nice to get finer control over the keyboard slide
gesture and animation. Move the gesture bits so they are together
at keyboard.js.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1668>

js/ui/keyboard.js
js/ui/windowManager.js

index ef655e3e0e72ab0ddde4aff42dc34f035c489fd0..e41a55d4a687496b182dd01c18f701888de1d305 100644 (file)
@@ -1,10 +1,11 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 /* exported KeyboardManager */
 
-const { Clutter, Gio, GLib, GObject, Meta, St } = imports.gi;
+const { Clutter, Gio, GLib, GObject, Meta, Shell, St } = imports.gi;
 const ByteArray = imports.byteArray;
 const Signals = imports.signals;
 
+const EdgeDragAction = imports.ui.edgeDragAction;
 const InputSourceManager = imports.ui.status.keyboard;
 const IBusManager = imports.misc.ibusManager;
 const BoxPointer = imports.ui.boxpointer;
@@ -1143,6 +1144,18 @@ var KeyboardManager = class KeyBoardManager {
             this._lastDevice = device;
             this._syncEnabled();
         });
+
+        const mode = Shell.ActionMode.ALL & ~Shell.ActionMode.LOCK_SCREEN;
+        const bottomDragAction = new EdgeDragAction.EdgeDragAction(St.Side.BOTTOM, mode);
+        bottomDragAction.connect('activated', () => {
+            this.open(Main.layoutManager.bottomIndex);
+        });
+        Main.layoutManager.connect('keyboard-visible-changed', (_manager, visible) => {
+            bottomDragAction.cancel();
+            bottomDragAction.set_enabled(!visible);
+        });
+        global.stage.add_action(bottomDragAction);
+
         this._syncEnabled();
     }
 
index 8e5c24ec464d48f4ed213ec1932fce5e8e03ad92..9d758dcd7d15e106ec025766cc90dacb51ecec51 100644 (file)
@@ -932,16 +932,6 @@ var WindowManager = class {
         global.stage.add_action(appSwitchAction);
 
         let mode = Shell.ActionMode.ALL & ~Shell.ActionMode.LOCK_SCREEN;
-        let bottomDragAction = new EdgeDragAction.EdgeDragAction(St.Side.BOTTOM, mode);
-        bottomDragAction.connect('activated', () => {
-            Main.keyboard.open(Main.layoutManager.bottomIndex);
-        });
-        Main.layoutManager.connect('keyboard-visible-changed', (manager, visible) => {
-            bottomDragAction.cancel();
-            bottomDragAction.set_enabled(!visible);
-        });
-        global.stage.add_action(bottomDragAction);
-
         let topDragAction = new EdgeDragAction.EdgeDragAction(St.Side.TOP, mode);
         topDragAction.connect('activated',  () => {
             let currentWindow = global.display.focus_window;